#include "bencoding.h"
namespace tinygoldmine
{

struct info_header
{
	binteger	piece_length_;
	bstring		pieces_;
	binteger	private_;
};

struct info_singlefile
{
	bstring		name_;
	binteger	length_;
	bstring		md5sum_;
};

struct info_multifile_sub
{
	binteger	length_;
	bstring		md5sum_;
	blist		path_;//list of string
};

struct info_multifile
{
	bstring		name_;
	blist		files_;
};

class info
{
private:
	bdict			files_info_;
	
	info_header		header_;
};

class metainfo
{
public:
	metainfo();
	
	bool encode_metainfo();
	bool decode_metainfo();
private:
	bdict		meta_;
	
	info		info_;
	bstring		announce_;
	blist		announce_list_;//list of lists of string
	binteger	creating_date_;
	bstring		comment_;
	bstring		create_by_;
	bstring		encoding_;
};

} // tinygoldmine